<?php

/**
 * sfGuardRegisterForm for registering new users
 *
 * @package    sfDoctrineGuardPlugin
 * @subpackage form
 * @author     Jonathan H. Wage <jonwage@gmail.com>
 * @version    SVN: $Id: BasesfGuardChangeUserPasswordForm.class.php 23536 2009-11-02 21:41:21Z Kris.Wallsmith $
 */
class sfGuardRegisterForm extends BasesfGuardRegisterForm
{
  /**
   * @see sfForm
   */
  public function configure()
  {
    $this->useFields(array('username', 'email_address', 'first_name', 'last_name', 'password', 'password_again'));
    
    $this->widgetSchema['company'] =  new sfWidgetFormInput();
    $this->validatorSchema['company'] = new sfValidatorString(array('max_length'=>0));
    $this->validatorSchema['company']->setOption('required', false);
    
    $this->validatorSchema['email_address'] =  new sfValidatorAnd(array(
            $this->validatorSchema['email_address'],
            new sfValidatorEmail()
            ));
    
    $this->validatorSchema['password'] = new sfValidatorAnd(array(
            $this->validatorSchema['password'],
            new sfValidatorString(array('min_length'=>6))
            ));
   }
}